package cn.wolfcode.crm.web.controller;


import cn.wolfcode.crm.query.SystemLogQueryObject;
import cn.wolfcode.crm.service.ISystemLogService;
import cn.wolfcode.crm.util.PageResult;
import cn.wolfcode.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("systemlog")
public class SystemLogController {


    @Autowired
    private ISystemLogService systemlogService;

    @RequestMapping("")
    @PermissionName("日志主页")
    @RequiresPermissions("systemlog:index")
    public String systemlogPage(){
        return "/systemlog/list";
    }

    @RequestMapping("list")
    @ResponseBody
    @RequiresPermissions("systemlog:list")
    @PermissionName("日志数据")
    public PageResult query(SystemLogQueryObject qo){
        PageResult result = systemlogService.query(qo);
        return result;
    }

}
